package com.zysoft.system.entity;

import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.OneToOne;
import javax.persistence.Table;

import org.hibernate.annotations.Cache;
import org.hibernate.annotations.CacheConcurrencyStrategy;
import org.hibernate.validator.constraints.NotEmpty;

import com.zysoft.common.entity.AbstractEntity;

@Entity
@Table(name = "SYS_Login_Authentication")
@Cache(usage = CacheConcurrencyStrategy.READ_WRITE)
public class LoginAuthentication extends AbstractEntity{

	@Id
	@NotEmpty(message = "{loginName.illegal.notEmpty}")
	private String loginName;
	private String loginPasswd;
	private boolean disenable = false;
	private boolean outside = false;
	@OneToOne(fetch=FetchType.LAZY)
	@JoinColumn(name="personId")
    private PersonInfo personInfo = new PersonInfo();
	
	public PersonInfo getPersonInfo() {
		return personInfo;
	}
	public void setPersonInfo(PersonInfo personInfo) {
		this.personInfo = personInfo;
	}
	public String getLoginName() {
		return loginName;
	}
	public void setLoginName(String loginName) {
		this.loginName = loginName;
	}
	public String getLoginPasswd() {
		return loginPasswd;
	}
	public void setLoginPasswd(String loginPasswd) {
		this.loginPasswd = loginPasswd;
	}
	public boolean isDisenable() {
		return disenable;
	}
	public void setDisenable(boolean disenable) {
		this.disenable = disenable;
	}
	public boolean isOutside() {
		return outside;
	}
	public void setOutside(boolean outside) {
		this.outside = outside;
	}
	
}
